<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ page import="com.buaa.utility.Constants"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="<%= request.getContextPath()%>/portal/js/ext-2.3.0/resources/css/ext-all.css" />
<script type="text/javascript" src="<%= request.getContextPath()%>/portal/js/ext-2.3.0/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="<%= request.getContextPath()%>/portal/js/ext-2.3.0/ext-all-debug.js"></script>
<script>
<%
	Throwable e = (Exception)request.getAttribute(Constants.REQUEST_KEY_ACTION_EXCEPTION);
	String title = null;
	String content = null;
	String msg = null;
	if(e==null){
		out.println("<h1>没有捕获到异常信息!</h1>");
	}else{
		int num = e.toString().indexOf(":");
		title = e.toString().substring(0,num+1);
		content = e.toString().substring(num+1);
		StackTraceElement[] es = e.getStackTrace();
		if(es!=null && es.length>0){
			for(int i=0;i<es.length;i++){
				msg +=es[i].toString()+"<br>";
			}
		}
	}
%>
Ext.onReady(function(){
	Ext.BLANK_IMAGE_URL = '<%=request.getContextPath()%>/portal/js/ext-2.3.0/resources/images/default/s.gif';
    var simple = new Ext.FormPanel({
       labelWidth: 75,
       frame:true,
       title: '异常信息',
       bodyStyle:'padding:5px 5px 0',
       
       defaultType: 'textfield',
	   html: '<span style="font-size:18px"><h1><%=title %></h1></span><br><span style="font-size:14px"><h3><%=content %></h3></span><br><div id="msgDiv" style="display:none"><%=msg %></div>',

       buttons: [{
           text: '详细信息',
           handler:function(){
           		var msgDiv = document.getElementById("msgDiv");
				if(msgDiv.style.display == "none"){
					msgDiv.style.display = "block";
				}else if(msgDiv.style.display == "block"){
					msgDiv.style.display = "none";
				}
           }
       }]
   });

   simple.render(document.getElementById("showDiv"));
});
</script>
</head>
<body>
<table width="95%" border="0" cellpadding="0" cellspacing="0" style="margin: 26px">
	<tr>
		<td>
			<div id="showDiv"></div>
		</td>
	</tr>
</table>
</body>
</html>



